<?php
$this->breadcrumbs = array(
	'入库单列表' => array(
		'index'
	),
	$model->project->name . ' (' . $model->submitDate . ')',
);
if (Yii::app()->user->checkAccess('materialWarehouseInboundManage')) {
	$this->userActions = array(
		//	array('label'=>'', 'url'=>array('index')),
		array(
			'label' => '新建入库单',
			'url' => array(
				'create'
			),
			'iconClass' => 'icon-lorry-add',
		),
		array(
			'label' => '更新入库单',
			'url' => array(
				'update',
				'id' => $model->id
			),
			'iconClass' => 'icon-lorry',
		),
		array(
			'label' => '删除入库单',
			'url' => '#',
			'linkOptions' => array(
				'submit' => array(
					'delete',
					'id' => $model->id
				),
				'confirm' => 'Are you sure you want to delete this item?'
			),
			'iconClass' => 'icon-lorry-delete',
		),
		array(
			'label' => '管理入库单',
			'url' => array(
				'admin'
			),
			'iconClass' => 'icon-lorry-link',
		),
		array(
			'label' => '管理 ' . $model->itemCount . ' 入库记录',
			'url' => array(
				'updateItems',
				'id' => $model->id
			),
		//'visible' => Yii::app()->user->checkAccess('materialWarehouseInboundManage'),
		),
	);
}
?>

<h1>查看入库单 <?php echo $model->project->name . ' (' . $model->submitDate . ') #'.$model->token; ?></h1>
<div>
<div class="span-2"><?php echo CHtml::link(CHtml::encode($model->submitDate),
						array(
							'view',
							'id' => $model->id
						), array(
							'target' => '_blank'
						));
					?></div>

<div class="span-3"><?php echo CHtml::encode($model->project->name); ?></div>
<div class="span-3">
	<?php echo CHtml::encode($model->getAttributeLabel('handler')); ?>:
	<?php echo CHtml::encode($model->handler); ?>
</div>
<div class="span-3">
	<?php echo CHtml::encode($model->getAttributeLabel('warehouseManagerId')); ?>:
	<?php echo CHtml::encode($model->warehouseManager->fullName); ?>
</div>
<div class="span-4">
	<?php echo CHtml::encode($model->getAttributeLabel('token')); ?>:
	<?php echo CHtml::encode($model->token); ?>
</div>
<div class="span-4 last">
	<?php echo CHtml::encode($model->getAttributeLabel('deliveryNumber')); ?>:
	<?php echo CHtml::encode($model->deliveryNumber); ?>
</div>
<div class="clear"></div>
<?php if ($model->note) { ?>
<div><?php echo CHtml::encode($model->getAttributeLabel('note')); ?>:
	<?php echo CHtml::encode($model->note); ?></div>
<?php } ?>
</div>
<div class="item-list-grid">
<?php
$this->renderPartial('_itemList', array(
		'items' => $model->items
	));
?>
</div>
<div class="span-7 item-meta">
	创建：<?php echo CHtml::encode($model->createUser->employee->fullName); ?>
	(<?php echo CHtml::encode($model->createTime); ?>)
</div>
<?php if ($model->updateUserId) { ?>
<div class="span-7 item-meta">
	最后更新：<?php echo CHtml::encode($model->createUser->employee->fullName); ?>
	(<?php echo CHtml::encode($model->createTime); ?>)
</div>
<?php } ?>
